﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.Qualification
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.Qualification;

    public class MapQualification : EntityMapping<Qualification>
    {
        public MapQualification()
        {
            //企业资质明细
            Bag(x => x.Details, map =>
            {
                map.Key(keyMapper => keyMapper.Column("D_Id"));
                map.Cascade(Cascade.None);
            }, rel => rel.OneToMany());

            //法律法规附件
            /*Bag(x => x.Attachment, map =>
            {
                map.Key(keyMapper => keyMapper.Column("A_Id"));
                map.Cascade(Cascade.None);
            }, rel => rel.OneToMany());*/

            //项目类型
            Property(x => x.Type, map =>
            {
                map.Length(100);
            });

            //项目内容
            Property(x => x.Content, map =>
            {
                map.Length(80000000);
            });

            //备注
            Property(x => x.Remark, map =>
            {
                map.Length(10000000);
            });
        }
    }
}
